package org.oaix.proxy.jdk;

import net.sf.cglib.proxy.Enhancer;
import org.oaix.proxy.Person;

public class CgLibProxy {
	public static void main(String[] args) {
		Class<Person> personClass=Person.class;
		Enhancer enhancer = new Enhancer();
		enhancer.setClassLoader(personClass.getClassLoader());
		enhancer.setSuperclass(personClass);
		enhancer.setCallback(new CgLibInterceptor());
		Person person=(Person)enhancer.create();
		System.out.println(person.add(11));
	}
}
